package com.example.userserver.controller;

import com.example.commons.utils.ApiResult;
import com.example.userserver.entity.ActivityInfoCollectEntity;
import com.example.userserver.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/info")
public class ActivityController {
    @Autowired
    private ActivityService activityService;

    @PostMapping("/collect")
    public ApiResult<?> brandSave(@RequestBody ActivityInfoCollectEntity activityInfoCollectEntity) {
        ApiResult<Object> result;
        try {
            result = ApiResult.success(activityService.addActivityInfo(activityInfoCollectEntity));
        } catch (Exception e) {
            result = ApiResult.fail("提交失败，请重试后联系工作人员！");
        }
        return result;
    }


}
